Change chronology view: a time-ordered bar of agent file changes in the attached view#149
Merged
Conversation
Extract spawn_parts from spawn_resolved's tail so the detach-spawn sequence lives in one place. Route both spawn_resolved and open_in_editor_at through it, eliminating the duplicate implementation introduced in c446025. Add a test proving {file}/{line} substitute when they appear in separate argv tokens.
Add `ChronologyConfig` / `ChronologyOverride` / `WidthSpec` / `Side`
types in `src/config/chronology.rs` with per-field merge, `sanitize()`
clamping, and `resolved_width()`. Wire the `repos.chronology_config`
TEXT column via schema migration v13, a new `set_repo_chronology_config`
setter, and an updated SELECT in `repos()` (indices 0-12). Sweep all
`Repo { .. }` struct literals to add `chronology_config: None`.
…ntry rects per frame
…modal Adds a ChronologyConfig variant to RepoSettingField (after DetailBarConfig) and wires it through every site the detail-bar config uses: the ALL array, label(), the editor-seed getter (reads repo.chronology_config), the modal row list, and apply_repo_setting. The apply arm validates the edited JSON as ChronologyOverride (the partial per-repo override type, mirroring how the detail-bar arm validates DetailBarOverride rather than the full config) and persists via store.set_repo_chronology_config, passing None when empty. Also adds a config test proving the per-repo override flows through resolve() when the global config is unset (side override -> Side::Left, other fields stay at global defaults).
The chronology bar's scroll offset and expanded-entry index persisted across focused-workspace switches, so they could point at an entry belonging to an unrelated workspace. Adds a chronology_last_workspace sentinel to App and a reset_chronology_state_on_workspace_change helper that zeroes the scroll and clears the expanded index when the focused workspace id changes, called in the attached renderer just before those fields are read. Mirrors the existing detail-bar reset_detail_scroll_on_workspace_change pattern.
…impls) - Remove the redundant trailing `return;` at the end of the chronology-click if/else-if chain in app/input.rs: the chain is the last statement in the mouse-down arm, so the early return was a no-op (control flow unchanged). - Replace the manual `impl Default for Side` with `#[derive(Default)]` plus `#[default]` on the Right variant. Side::Right stays the default and the serde `rename_all = "lowercase"` is preserved.
…nt in bar rendering
…orks
Adds a `path` parameter to `resolve_editor_at_argv` and substitutes
`{path}` (the worktree) across all tokens before the `{file}`/`{line}`
logic, so a command like `xdg-terminal-exec --dir={path} nvim` works
for the chronology bar's open-at-line action as well as the dir-open
action. Updates all 12 existing call sites and adds 2 new tests.
README updated to document `{path}` substitution for this action.
…ad_full_change) Add ChangeSource back-reference on ChangeEvent (session_file, line_index, index_in_line), thread detail_max through extract_change_events so clip is parameterised, populate source in parse_file, and expose load_full_change for on-demand unclipped re-extraction from the session log. Fix all ChangeEvent literals and extract_change_events call-sites across the codebase to compile cleanly.
There was a problem hiding this comment.
Pull request overview
Adds an “attached view” Change Chronology side bar that reconstructs agent file edits (newest-first) from Claude session JSONL logs, supports keyboard/mouse navigation, opens a full diff modal with basic syntax highlighting, and introduces global + per-repo chronology_config plus editor open-at-line integration.
Changes:
- Introduce chronology data pipeline (
activity::chronology), rendering helpers, navigation reducer, and attached-view integration (layout carve-out, hit testing, modal open). - Add
chronology_configglobal/per-repo configuration (schema, CLI validation/seed, DB migration + repo settings UI). - Add detail modal improvements: syntax highlighting + styled diff rendering, scroll/keyboard/mouse handling, and editor open-at-line with
{file}/{line}placeholder + editor auto-detection.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/syntax.rs | New dependency-free tokenizer + styled diff line builder + horizontal clipping for the ChangeDetail modal. |
| src/ui/modal.rs | Add Modal::ChangeDetail variant; expose chronology_config in repo settings rows. |
| src/ui/mod.rs | Export chronology bar/nav/syntax modules. |
| src/ui/dashboard/tests.rs | Extend fake repo fixtures with chronology_config. |
| src/ui/chronology_nav.rs | New pure keyboard navigation + scroll helpers for chronology list/modal. |
| src/ui/chronology_bar.rs | Pure rendering helpers for the chronology list (path formatting, entry lines, auto-hide). |
| src/ui/attached.rs | Carve chronology side column, render bar, and return per-entry hit rects to input layer. |
| src/detail_modules/mod.rs | Update leaked test repo fixture with chronology_config. |
| src/data/store.rs | Add repos.chronology_config column migration, query plumbing, setter, and round-trip tests; bump user_version to 13. |
| src/data/repo.rs | Update repo settings tests for new field. |
| src/config/mod.rs | Export new chronology config module. |
| src/config/detail_bar_config.rs | Update test repo fixture to include chronology_config. |
| src/config/chronology.rs | New global+repo override config resolver with sanitize + width calculation. |
| src/commands/external.rs | Add open_in_editor_at with {file}/{line} injection and wrapper-editor detection; add editor_open_decision; refactor spawn helpers. |
| src/cli.rs | Recognize/validate/seed chronology_config setting; tests for validation + seed JSON. |
| src/app/render.rs | Refresh chronology timeline, carve bar before pane layout, store hit rects; render ChangeDetail modal. |
| src/app/input.rs | Add chronology leader bindings (Ctrl-x c/C), focus routing, bar nav interception, modal open/scroll/editor open, bar wheel+click handling. |
| src/app.rs | Add app state for chronology timelines + focus/scroll/selection; add repo settings field + apply logic. |
| src/agent/related.rs | Update test fixture repo struct with chronology_config. |
| src/activity/mod.rs | Export new chronology module. |
| src/activity/chronology.rs | New timeline builder from Claude JSONL logs with per-file cache, summarization, full-change re-extraction, and line resolution. |
| README.md | Document chronology bar, keybindings, detail modal behavior, and editor open-at-line configuration/injection. |
| docs/superpowers/specs/2026-06-06-chronology-syntax-highlight-design.md | Design spec for syntax highlighting in ChangeDetail modal. |
| docs/superpowers/specs/2026-06-06-chronology-editor-open-design.md | Design spec for config-driven editor open-at-line behavior. |
| docs/superpowers/specs/2026-06-06-chronology-detail-modal-design.md | Design spec for full diff modal overlay and list-only bar. |
| docs/superpowers/specs/2026-06-06-chronology-detail-line-numbers-design.md | Design spec for diff gutter line numbers (historical reference). |
| docs/superpowers/specs/2026-06-05-chronology-keyboard-navigation-design.md | Design spec for chronology keyboard navigation model. |
| docs/superpowers/specs/2026-06-05-change-chronology-view-design.md | Design spec for the chronology bar feature + config + data source. |
| docs/superpowers/plans/2026-06-06-chronology-syntax-highlight.md | Implementation plan for syntax highlighting changes. |
| docs/superpowers/plans/2026-06-06-chronology-editor-open.md | Implementation plan for editor open-at-line changes. |
| docs/superpowers/plans/2026-06-06-chronology-detail-modal.md | Implementation plan for detail modal + bar simplification. |
| docs/superpowers/plans/2026-06-06-chronology-detail-line-numbers.md | Implementation plan for line-number gutter (historical reference). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Throttle the per-frame chronology refresh (read_dir + per-file stat) to ~3x/sec, refreshing immediately on first focus of a workspace so the bar isn't briefly empty. - Clamp the bar wheel-scroll to the last page (len - visible) via clamp_scroll, instead of len-1 which let it scroll into empty space. - Detail-modal footer shows "0-0/0" for an empty change instead of "1-0/0". Declined: closing the modal on any click (vs only outside-click) is kept as-is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a toggleable vertical Change Chronology bar to wsx's attached view: a newest-first, time-ordered series of the individual file changes the agent made — one entry per edit (not a commit list) — to help you keep your sense of where code lives and why under agentic editing.
(size, mtime).file:line.chronology_configJSON, resolved globally (wsx config set) and per-repo (repo-settings modal), mirroring the existingdetail_bar_configpattern.open_in_editor_atadds{file}/{line}placeholders with goto fallbacks (code --goto file:line,vim/nvim/emacs +line file).Keybindings (attached, under the
Ctrl-xleader)Ctrl-x c— toggle the barCtrl-x C— swap side (left/right)Scope
Implemented end-to-end for Claude sessions. Codex/Pi/Hermes feeds are a deliberate, documented follow-up — see "Phase 8 scope correction" in the plan: none of those parsers currently expose file paths/change text, and Hermes is a SQLite store (not files), so each needs format-specific work against real session samples. Non-Claude agents show an empty bar (em-dash placeholder), never a crash.
Design & plan
docs/superpowers/specs/2026-06-05-change-chronology-view-design.mddocs/superpowers/plans/2026-06-05-change-chronology-view.mdBuilt task-by-task (TDD) with per-task spec + code-quality review and a final whole-feature review.
Test Plan
cargo test --lib— 1098 passing, 0 failingcargo build— zero warningscargo clippy --lib— no warnings in feature filescargo fmt --check— cleanCtrl-x ctoggles;Ctrl-x Cswaps side; wheel scrolls; click expands a diff peek; second click opens the editor at the right linewsx config set chronology_config '{"side":"left","width":{"min_cols":30}}'(global) and a per-repo override via the repo-settings modal both take effect live